﻿<%@ Page Title="" Language="C#" MasterPageFile="~/LeftColumn.master" AutoEventWireup="true" CodeBehind="Sales.aspx.cs" Inherits="Supermarket.Web.CashierPages.Sales" %>
<%@ Register src="~/UserControls/UserControlBuyProduct.ascx" TagName="ucBuyProduct" TagPrefix="uc"%>
<asp:Content ID="Content1" ContentPlaceHolderID="RightContent" runat="server">    
    <asp:MultiView ID="MultiViewSales" runat="server" ActiveViewIndex="0">
        <asp:View ID="ViewProducts" runat="server">
            <h2>Продаване на стоки</h2>
            <div style="float:right; display:block">
                <asp:LinkButton ID="LinkButtonPay" Text="Закрий сметката" runat="server" 
                    onclick="LinkButtonPay_Click" />
            </div>
            <br /><br />
            <asp:GridView ID="GridViewProducts" runat="server" AllowPaging="True" 
                BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
                CellPadding="3" CellSpacing="2" DataSourceID="odsProducts" PageSize="15" 
                AutoGenerateColumns="False" DataKeyNames="ProductId" 
                onrowcommand="GridViewProducts_RowCommand" >
                <Columns>
                    <asp:BoundField DataField="ProductName" HeaderText="Продукт" ReadOnly="True" 
                        SortExpression="ProductName" />
                    <asp:BoundField DataField="ProductPrice" HeaderText="Цена" ReadOnly="True" 
                        SortExpression="ProductPrice" DataFormatString="{0:0.00}" />
                    <asp:BoundField DataField="MeasureCode" HeaderText="Код" ReadOnly="True" 
                        SortExpression="MeasureCode" />
                    <asp:BoundField DataField="CompanyName" HeaderText="Производител" 
                        ReadOnly="True" SortExpression="CompanyName" />
                    <asp:BoundField DataField="CategoryName" HeaderText="Категория" ReadOnly="True" 
                        SortExpression="CategoryName" />
                    <asp:BoundField DataField="InStock" HeaderText="Наличност" ReadOnly="True" 
                        SortExpression="InStock" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonBuy" Text="Купи" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#FFF1D4" />
                <SortedAscendingHeaderStyle BackColor="#B95C30" />
                <SortedDescendingCellStyle BackColor="#F1E5CE" />
                <SortedDescendingHeaderStyle BackColor="#93451F" />
            </asp:GridView>
        </asp:View>
        <asp:View ID="ViewBuyProduct" runat="server" 
            onprerender="ViewBuyProduct_PreRender">            
            <uc:ucBuyProduct ID="ucBuyProduct" runat="server" />
        </asp:View>
    </asp:MultiView> 
    <asp:ObjectDataSource ID="odsProducts" runat="server" 
        SelectMethod="GetAvailableProducts" TypeName="Supermarket.Bll.ProductManager"></asp:ObjectDataSource>   
</asp:Content>